package config;

import java.io.FileWriter;
import java.io.IOException;

/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *修改日期：2017-04-05
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 */

public class AlipayConfig {

//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

    // 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
    public static String app_id = "2021000121697806";

    // 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQCu5xsvgFBOfIbmrw9D9ElIpA4SwFel+FgQpaGZsmYK4f2c8nWV+EHOY9BCRdbky9Jt6JvOMTIdwkkWcnhxHgw5cjA/ejb1DuBfspWOekR4yT8pDuEoHNvwmitSdtPC9uViHgX10xgfzgTGHdM+Phl+eH2tx5AAscB9Q/MsmEbQZg9vsBwklxIwtLVNLn7RBYuk+RnWJsrn7oDGKosU2sxc3cdkqB1iBHn+jU4aSpp8m9eKVpTzRdPc1V4X2gRuYu/tnLygInAajY8lOn7M+ChR1gJvGUGu+Q8dbOWbplakdMR/v+F/GOOF4/NoSAGDVIEhmSz8Ofebr6s/RvwO7q4ZAgMBAAECggEBAKEUHLhpnww5qW/ox9FYuOlalc91LwOerVRfhm3rnAjnys9xiROeONTgnht7AIdko58ve9aw/ivkE7XFpODgwHdjj8XWQ6j7k27vJMe8GTV4el/Q4VI1CeYTxlRDNZG4Gtd7ORgF2pDoBwOC0lrfjFEqnOyf/yJ0kgeLvfhTIdyoqrnt8p6bcjyy1jbnoRC1DVlo7U0jdLmABYqCZbvxLjzmrwFt2XPDOvgRjdz9kYstpulG7sXO3glDbIgWpS8GGHs82hY6qVTRD0CAC2hmFhLpETBLlMZUwsPmNMZAMimZUaZ4BiyfcZDinQvG1i0yiHqcFEAvx0sr4oJgzw/GKQECgYEA5235UWl0wj+zwq57/ZS2BdHVD2/tt8lzzF/Cu0FphI/i6WqAO9DByY9LVa0iFddf9wBAgc4usHd/JZPPaifaQ6dyl77yHVHil3e9o7wBfqGnp9UEd9uTi0mqrbSwS7kk8kk60Uy7mlmdDdmc00hABockayBAeC7/Uz2rcUhISrkCgYEAwXjKER+n2Itnd7vqywBJESqgqd5KVn+koHaKSP5iEv2E6uVmGnjbTjOp04yRh4oHTeASyq1J2XaCJm6xjGUMvqRt0rxLK1P67k5VjywnOr2rEHOgCMPE0t817QwomDGQl0mlUQ3PI0L8G5zYEnQZSSxRBhgiij+4bvw4OQ/2TmECgYBuuvrIjjmUW6Bp7Mxcl1PEUxKrUTWfcx8Z0VO9/t061RGP9yol9ItUImC8PJuLccJzz0YOFZXXT0WhuChMtYbEShEVNAJqLuzI5jzxY5ofeb9bGRwLMR9WTMgCVurnQE3CM3GWBS3Z+zifENjtaqtftDejngnatznpHR+zkw8r2QKBgQCNK2HmFL8YVr/ssgWkklS+XehViombjA/Htjc5A8T0LmBqNXDHKCB9c10bq5oU2DZ0MGgF02PrdXmKKYML+j/Oa5RnDFWdC+4xLJ9plMIbLoI/wt6nBpH7fDuQ+Co2wxPKEEa8WeMmy53BWDShYm2A4wFL/RhW4B/ne8paeLc0gQKBgQDctfuq47Qa0v7jlj+w1KGlAvu9FDo4PQbnMySBhxbaOLOi68MjnJ3m4/clHt3YeFtM7wsWMgbw0W7cNNtfkuVtV/OAkYwzQudKLyDqJYUW107lK+LHsYJyZ6977iBAz6uphFisCU4MgzdHETXcTh2pz9ylLrgI0omkCwqf4D4SFg==";

    // 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAk90hMzyJChWOmYb6G5syfhwiz7hSS9HHhFBagsjKqJYzXIkXiFDgpjk2RC5FWQHtXd6f0MGgpOtxNIEzI6Ue4A1Bq9CtMPfzBTw4sWqEpIOJ6T/B6eMSAIaXLBD4Yog2g5q2GztwcGSA7IupabGwe+vM9S+88RJYYXVWDDeK04k1mMVU+H06bQciO6hTvVsEK2m9Xqu9Eta1bPddDnIjzAoJAq8NoPPn4XNTJtt+9Stn+If8scHcHYBG7TA8IIuA/Uoy1pK1X+VRZLO9TYZS5CmQ5iHPJ6OscxI8KXx3Ys6OgKlzQSXW0SbUEFOZbiV/2UbYoh0a1D4//DssfMG7yQIDAQAB";

    // 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String notify_url = "http://e94pxh.natappfree.cc/Indenture/notify_url.jsp";

    // 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String return_url = "http://e94pxh.natappfree.cc/Indenture/return_url.jsp";

    // 签名方式
    public static String sign_type = "RSA2";

    // 字符编码格式
    public static String charset = "utf-8";

    // 支付宝网关
    public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";

    // 支付宝网关
    public static String log_path = "C:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /**
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     *
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis() + ".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}

